package com.atguigu.springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @Author csc
 * @Date 2023/3/12 0012 19:26
 * @Version 1.0
 */
@Configuration
public class ApplicationContextConfig {

    @Bean
    @LoadBalanced //通过这个注解开启RestTemplate 负载均衡的功能
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }

}
